Skip to content

Conversation

florence-crl
Copy link
Contributor

@florence-crl florence-crl commented Oct 3, 2025

Fixes DOC-14622 DOC-14631 DOC-14634 DOC-14650 DOC-14818

  • In session-vars.md, added row for allow_unsafe_internals.
  • In crdb-internal.md, added a section for Access control.
  • In functions-and-operators.md, removed reference to a crdb_internal built-in function.
  • In logging-use-cases, added a section for Example: Unsafe internals.
  • In system-catalogs.md, added description of allow_unsafe_internals with a warning.

Rendered preview

In crdb-internal.md, added a section for Access control.

In functions-and-operators.md, removed reference to a crdb_internal built-in function.

In logging-use-cases, added a section for Example: Unsafe internals.

In system-catalogs.md, modified by codex.
Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 6374903
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/68e40218b908a200080c09d5

Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 6374903
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/68e40218d8c1ae0008a5c8e9

Copy link

netlify bot commented Oct 3, 2025

Netlify Preview

Name Link
🔨 Latest commit 6374903
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/68e4021820bcdf00083ebfc5
😎 Deploy Preview https://deploy-preview-20486--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@florence-crl florence-crl changed the title DOC-14622: Product Change- PR #151362 - sql: gate system database behind session variable v25.4 changes related to allow_unsafe_internals session variable Oct 6, 2025
Copy link

@angles-n-daemons angles-n-daemons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple quick comments, thanks for this!

| Variable name | Description | Initial value | Modify with [`SET`]({% link {{ page.version.version }}/set-vars.md %})? | View with [`SHOW`]({% link {{ page.version.version }}/show-vars.md %})? |
|---|---|---|---|---|
| <a id="always-distribute-full-scans"></a> `always_distribute_full_scans` | When set to `on`, full table scans are always [distributed]({% link {{ page.version.version }}/architecture/sql-layer.md %}#distsql). | `off` | Yes | Yes |
| <a id="allow-unsafe-internals"></a><span class="version-tag">New in v25.4:</span> `allow_unsafe_internals` | Controls access to unsafe internals in the `system` database and the [`crdb_internal`]({% link {{ page.version.version }}/crdb-internal.md %}#access-control) schema. When set to `off`, only allowlisted objects are accessible without internal privileges.<br><br>**Warning**: In future releases, this session variable will default to `off` and then will be removed. To assess potential downstream impacts on your setup, set `allow_unsafe_internals` to `off` in a non-production environment. | `on` | Yes | Yes |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Florence, I'm not sure whether we're planning to remove this variable, can you double check that with Kevin?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree! Let's not call out removal yet.

SET allow_unsafe_internals = off;
~~~

When set to `off`, external sessions can read only the allowlisted `crdb_internal` objects that are supported for production use (the tables marked ✓ in the table below). All other tables and built-in functions that use the `crdb_internal` namespace require either an internal caller or explicitly enabling `allow_unsafe_internals` for the session:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to mention "internal callers" it might be worth defining what that means a little further down.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed with @kevin-v-ngo : direct access to these tables will not be available for end users. Add a footnote that some crl tools (console and debug zip) may use these and will be unaffected.


These events record both successful and denied attempts to access internal system objects.

This command enables access to unsafe internals for the user `max`:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: unless max is a common moniker for a db user, it might be worth choosing a different name. max is a keyword which commonly shows up in postgres sql and other programming languages.

All possible `SENSITIVE_ACCESS` event types are detailed in the [reference documentation]({% link {{ page.version.version }}/eventlog.md %}#sql-access-audit-events). For a detailed tutorial on table auditing, see [SQL Audit Logging]({% link {{ page.version.version }}/sql-audit-logging.md %}).
{{site.data.alerts.end}}

#### Example: Unsafe internals

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this section is great 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants